This feature provides the user with an easy to use console to develop and test JavaScripts on WEB elements.
In order to open the console, open the object spy, right click on a WEB element (does not matter which one), and click on Open JavaScript Console.
The console dialog box will open. Now you can develop and test the result of your JavaScript by using the Run button, and once the script is fully developed, just copy it and insert it in the Scriptparameter of the HybridRunJavaScript command. The command will return the result as a string.
For very short scripts an execution error may occur.
This can be handled by adding a property to app.properties file (located at %appdata%\silkmobile\app.properties ), a property named "js.nap.time" with the delay time in milliseconds.
For example:
js.nap.time=30This will make sure that every script from the JavaScript console will last at least 30 milliseconds.
In the following example, we will create a script that extracts the text color of a WEB element: